import Mock from 'mockjs'

const data = Mock.mock({
  'items|20': [{
    id: '@id',
    org: '@sentence(1, 5)',
    'status|1': ['published', 'draft', 'deleted'],
    name: 'name',
    date: '@datetime',
    sex: '@integer(30, 500)',
    'children|5': [{
      id: '@id',
      org: '@sentence(1, 5)',
      'status|1': ['published', 'draft', 'deleted'],
      name: 'name',
      date: '@datetime',
      sex: '@integer(30, 500)',
    }]
  }]
})

export default [
  {
    url: '/table/list',
    type: 'get',
    // params: {},
    response: config => {
      const items = data.items
      return {
        code: 20000,
        data: {
          total: items.length,
          items: items
        }
      }
    }
  }
]
